package com.oocl.ita.checks.collector;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Session;
import org.apache.activemq.command.ActiveMQQueue;
import com.oocl.ita.util.JMSUtil;

public class CollectChecks {
	public static void main(String[] args) throws JMSException {
		Destination queue = new ActiveMQQueue(JMSUtil.QUEUE);
		Connection con = JMSUtil.getConnection();
		con.start();
		Session session = con.createSession(true, Session.CLIENT_ACKNOWLEDGE);
		ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(2); 
		scheduledThreadPool.schedule(new JMSMsgReceive(session, queue), 1, TimeUnit.SECONDS);
	}
}
